package Operation;

import Books.Book;
import Books.Booklist;

import java.util.Scanner;

public class Addbook implements IOPeration{
    @Override
    public void work(Booklist booklist) {
        System.out.println("增添图书");
        System.out.println("请输入你要增添图书的信息");
        Scanner scanner=new Scanner(System.in);
        String name= scanner.nextLine();
        System.out.println("请输入该图书的作者");
        String author=scanner.nextLine();
        System.out.println("请输入该图书的价格");
        int perice=scanner.nextInt();
        System.out.println("请输入该图书的类型");
        String type= scanner.nextLine();
        String to=scanner.nextLine();
        Book books=new Book(name,author,perice,type);
         int usersize= booklist.getUsersize();
        booklist.setUsersize(usersize+1);
        booklist.setbook(usersize,books);


    }
}
